package demo03;

public class Student extends Person{
    private String no ;
    private double scoreEn ;
    private double scoreMath ;
    private double scoreCh ;
    public Student() {
        super();
    }

    public String getNo() {
        return no;
    }
    public void setNo(String no) {
        this.no = no;
    }
    public double getScoreEn() {
        return scoreEn;
    }
    public void setScoreEn(double scoreEn) {

        this.scoreEn = scoreEn; }
    public double getScoreMath() {
        return scoreMath;
    }
    public void setScoreMath(double scoreMath) {
        this.scoreMath = scoreMath;
    }
    public double getScoreCh() {
        return scoreCh;
    }
    public void setScoreCh(double scoreCh) {
        this.scoreCh = scoreCh;
    }

    public double aver(){
        double f = (scoreCh+scoreEn+scoreMath)/3;
        return f;
    }
    public double max(){
        double m = Math.max(Math.max(scoreCh,scoreEn),scoreMath);
        return m ;
    }
    public double min(){
        double n = Math.min(Math.min(scoreMath,scoreCh),scoreEn);
        return n ;
    }
    @Override
    public String toString() {
        return
                "姓名：" + name + '\t' +
                        "性别：" + sex + '\t' +
                        "年龄：" + age+'\t'+
                        "学号：" + no +'\n'+
                        "英语成绩：" + scoreEn +'\t'+
                        "数学成绩：" + scoreMath +'\t'+
                        "语文成绩：" + scoreCh+'\n'+
                        "平均分："+aver()+'\t'+
                        "最高分："+max()+'\t'+
                        "最低分："+min();
    }
}
